﻿<%@ Page Language="C#" MasterPageFile="~/Management/ManagementMasterPage.master"
    AutoEventWireup="true" CodeBehind="GoodChoice.aspx.cs" Inherits="WebApp.Management.Product.GoodChoice"
    Title="Untitled Page" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphContent" runat="server">
    搜索（按名称）
    <br />
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:Button ID="Button5" runat="server" onclick="Button5_Click" Text="搜索" />

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        onrowcommand="GridView1_RowCommand" AllowPaging="True" 
    onpageindexchanging="GridView1_PageIndexChanging" PageSize="8">
        <Columns>
            <asp:TemplateField HeaderText="操作">
                <ItemTemplate>
                    <asp:Button ID="Button3" runat="server" Text="选择" CommandArgument='<%#Eval("ProductId") %>' CommandName="OnSelect" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="ProductId" HeaderText="ProductId" />
            <asp:BoundField DataField="Name" HeaderText="Name" />
            <asp:BoundField DataField="网络零售价" HeaderText="网络零售价" />
        </Columns>
    </asp:GridView>
    <hr />
    <asp:HiddenField ID="HiddenField1" runat="server" />
    
    当前的特惠精选产品
    <asp:GridView ID="GVGoodChoiceProducts" runat="server" 
        AutoGenerateColumns="False" AllowPaging="True" 
    onpageindexchanging="GVGoodChoiceProducts_PageIndexChanging" 
    onrowcommand="GVGoodChoiceProducts_RowCommand" PageSize="8" 
        onrowcancelingedit="GVGoodChoiceProducts_RowCancelingEdit" 
        onrowediting="GVGoodChoiceProducts_RowEditing" 
        onrowupdating="GVGoodChoiceProducts_RowUpdating">
        <Columns>
            <asp:TemplateField HeaderText="删除">
                <ItemTemplate>
                    <asp:Button ID="Button4" runat="server" Text="删除" CommandArgument='<%#Eval("ProductId") %>'
                        CommandName="OnDelete" />
                    <cc1:ConfirmButtonExtender ID="Button4_ConfirmButtonExtender" runat="server" ConfirmText="确认要删除吗?"
                        Enabled="True" TargetControlID="Button4">
                    </cc1:ConfirmButtonExtender>
                </ItemTemplate>
                <EditItemTemplate>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="ProductId" DataField="ProductId" ReadOnly="true" />
            <asp:BoundField HeaderText="Name" DataField="Name" ReadOnly="true"/>
            <asp:BoundField HeaderText="PictureUrl" DataField="PictureUrl" ReadOnly="true"/>
            <asp:BoundField HeaderText="Price" DataField="Price" ReadOnly="true"/>
            <asp:BoundField HeaderText="Views" DataField="Views" ReadOnly="true"/>
            <asp:TemplateField HeaderText="Sequence">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Sequence") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Sequence") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Button ID="Button1" runat="server" Text="编辑序号" CommandName="Edit" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:HiddenField ID="HiddenField2" runat="server" Value='<%#Eval("Id")%>' />
                    <asp:Button ID="Button9" runat="server" Text="确定" CommandName="Update" />
                    <asp:Button ID="Button6" runat="server" Text="取消" CommandName="Cancel" />
                </EditItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
     
</asp:Content>
